/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.gss

import org.gss.styles.*

/**
 *
 * @author btilford
 */
final class Rule {

    String name
    Map<String,Declaration> declarations = [:]

    Declaration getHeight() {return declarations.height}
    void setHeight(Value value) {
	declarations.height = new Declaration(name:"height",value:value)
    }

    Declaration getWidth() {declarations.width}
    void setWidth(Value value) {
	declarations.width = new Declaration(name:"width",value:value)
    }

    Declaration getColor(){return declarations.color}
    void setColor(Value value) {
	declarations.color = new Declaration(name:"color",value:value)
    }


    Declaration getBorder(){return declarations.border}
    void setBorder(Value value) {
	declarations.border = new Declaration(name:"border",value:value)
    }
    void setBorder(Declaration border) {
	declarations.border = border
    }

    String toString() {
	def str = new StringBuilder(name)
	str << "{"
	for(style in declarations.values()) {
	    str << "\n\t"
	    str << style.toString().trim()
	}
	str << "\n}\n"
    }
}


